import request from '@/utils/request'
const GET = 'GET';
const POST = 'POST';

const COMMON = "/pyCommon";
const UPLOAD_IMG = COMMON + "/img";
const UPLOAD_AVATAR = COMMON + "/avatar";

/**
 * 文章上传图片
 * @param {图片 File}} data 
 */
export function uploadImg(data) {
    return request({
        url: UPLOAD_IMG,
        method: POST,
        data
    })
}

/**
 * 用户上传头像
 * @param {图片file} data 
 */
export function uploadAvatar(data) {
    return request({
        url: UPLOAD_AVATAR,
        method: POST,
        data
    })
}